Skip to content

findings: what the static-sampler places do on driver 621.24 - #2921

Closed
fiestorra wants to merge 1 commit into
ProjectLeonida:mainfrom
fiestorra:findings-places-62124
Closed

fiestorra wants to merge 1 commit into
ProjectLeonida:mainfrom
fiestorra:findings-places-62124

Conversation

@fiestorra

Copy link
Copy Markdown
Contributor

pipeline/places.rs is a model of one card and one driver — its own first lines say RTX 4060 Ti, 616.64 — and findings.md records that model. On an RTX 4090 with 621.24, four of its five tests fail, and the reason is one behaviour the model gets the other way round. This adds that measurement to findings.md, where the rest of it lives.

The measurement. the_table_of_static_samplers prints the places 0 to 15 hold after each of its steps. The one that differs:

host                : places 0 to 15 hold [0, 1, ..., 15]
host;make=22,20,21  : places 0 to 15 hold [0, 1, ..., 15]     <- unchanged

The model says the three samplers made since take 0, 1 and 2 and the sixteen slide to 3..15 — [22, 20, 21, 0..12], which is the vector the section above records for 616.64. On 621.24 they do not slide: a loaded pipeline keeps the places it was stored with. KelboLive measured the same on an RTX 4070 Ti SUPER with 621.01, and a_loaded_pipeline_keeps_its_places_or_loses_them prints keeps its places on both.

At run time nothing harmful follows. Places::check loads a stored pipeline and compares it with one made now; on 621.24 it finds no difference, reports same, and the library is used — correctly, because the places really are the ones the pipeline was stored with. The numbering at the start still happens; it is now unnecessary on this driver rather than wrong.

For the tests it changes four, red on 621.24 and only there. the_check_looks_at_every_kind_of_sampler is the clearest: it makes the places shift on purpose and expects the check to say so; with no shift the check answers same, which is the truth.

What this does not do: update those four. With one driver measured and the other machine missing, a test that accepted both would stop reporting the change it exists to report. What would settle it is the command already in the section above — cargo test -p leonida-gpu --features diagnostics --lib pipeline::places -- --ignored — run on a 40-series card with 616.64; two runs of it there and here say whether the bit is the driver version or the card.

Nothing but the document: one file, 37 lines, no code and no test touched.

AI-assisted: yes — DeepSeek v4.1 (flash), which ran the model, printed the places, and then found the driver had moved.

Written with an AI assistant.

places.rs models one card and one driver - RTX 4060 Ti, 616.64, as its own first
lines say - and the section above records that model. On an RTX 4090 with 621.24
four of its five tests fail, and the reason is a single behaviour the model gets
the other way round.

On 616.64 a loaded pipeline gives its static-sampler places back: the root
signature goes, the place with it, the next samplers made take the lowest free
ones and a stored pipeline reads through whatever is now at its old places.
That is the fault the numbering at the start exists to survive.

On 621.24 the sixteen stay where the first run left them:

  host                : places 0 to 15 hold [0, 1, ..., 15]
  host;make=22,20,21  : places 0 to 15 hold [0, 1, ..., 15]   unchanged

KelboLive measured the same on an RTX 4070 Ti SUPER with 621.01.

At run time this changes nothing harmful: Places::check loads a stored pipeline,
compares it with one made now, finds no difference, reports "same", and the
library is used - correctly, because the places are the ones the pipeline was
stored with. The numbering still happens and is now unnecessary on this driver
rather than wrong.

The four tests are left as they are, deliberately: with one driver measured and
the other machine missing, a test accepting both would stop reporting the change
it exists to report. What would settle it is the command in the section above,
run on a 40-series card with 616.64.

Written with an AI assistant.

@KelboLive KelboLive left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: the conclusion does not hold on the card this section cites. On an RTX 4070 Ti SUPER / 621.01, store pipe=g:0-15, then run host;make=22,20,21;pipe=g:0-15 and the loaded graphics pipeline reads [22, 20, 21, 0..12] (wrong 16), while the c and s controls read [0..15] (wrong 0). The suite reproduces it independently: a_stored_pipeline... second run has g [43,44] wrong 2 (tests.rs:857), and pipelines_with... has g [2,3] for [4,5] with places: "same" (tests.rs:1025).

So the places still slide — only compute/stream changed on 621.x. And Places::check compiles and loads compute only (places.rs:586-603), so a make-before-the-list run answers same, the library is used, and graphics pipelines sample through the wrong samplers. That is the harm the check exists to prevent, so "nothing harmful" (findings.md:588-591) and "unnecessary rather than wrong" do not hold for graphics. The model needs splitting by pipeline kind, not accepting both outcomes.

Four factual corrections:

  1. findings.md:585 cites a test that does not exist — a_loaded_pipeline_keeps_its_places_or_loses_them. The open #2887 adds ..._or_gives_them_back, and it is compute-only, so it prints "keeps" and misses this case. Don't lean on an unmerged PR for the section's evidence, and use its real name if you do.
  2. 3..15 should be 3..18 (:583-584): sixteen places cannot occupy 13 slots, and [22,20,21,0..12] shows only 13 in the window.
  3. "four of its five tests" (:568, :593) — the file has 12 #[test]/7 card tests; name the four (857, 915, 1025, 1216). "All of them asserting the 616.64 vectors" is also wrong: 1025 fails on a graphics read, and 1112/1216 assert places == "differ".
  4. The "two runs on a 40-series card with 616.64" comparison cannot separate driver from card (:598-600) — that is the existing 4060 Ti baseline. The missing cells are 616.64 on the 4090 (or 621.x on the 4060 Ti), per pipeline kind.

Structure: the new ## at :565 re-parents the pre-existing ### The precompile and the game's pipelines (:602) under the 621.24 section — move the new section below it or make it ###.

Verified good: +37/−0 one file, the two quoted host lines reproduce exactly, the LEONIDA_LIBRARY_STATIC_SAMPLERS description is right (places.rs:1078-1132), docs tests and d3d12_switches.py --check pass, and merge-tree is clean.

@Christopher-Sundeby

Christopher-Sundeby commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

One correction to "at run time nothing harmful follows": it holds for compute pipelines, not for graphics ones.

Your own 621.24 run of a_stored_pipeline_reads_through_the_places_of_the_run_that_stored_it shows it. The loaded pipelines read [[6, 7], [43, 44], [1, 2, 3]] (s, g, c). The graphics one reads [43, 44], the samplers now at its stored places, instead of [4, 5]. The RTX 5090 with 621.40 gives the same vector in every run. In the same test, a careless run (=1, two samplers made first) loads the graphics pipeline with wrong 2 in every run, and occasionally a compute one as well (details on #2887).

The "keeps its places" probe and the places 0 to 15 hold [0..15] step both use compute pipelines only. Places::check also probed with compute only, so on these drivers it answered same while graphics pipelines read through other samplers. #2919 adds a drawn probe for that. The findings entry would be accurate as "a loaded compute pipeline keeps its places; a loaded graphics pipeline does not".

AI-assisted: yes (Claude Opus 5.5, via Claude Code).

@fiestorra

Copy link
Copy Markdown
Contributor Author

Closing in favour of #2996, which is the same section with the measurement this one was missing.

Both add a ## section to d3d12/docs/findings.md for the same thing - what driver 621.24 does with the static sampler places - and they would fight in the same file:

#2921  +## The static samplers' places on driver 621.24 (2026-12-01)
#2996  +## What driver 621.24 does with those places (2026-12-01)

#2996 carries everything this one says and adds the cost, measured afterwards by running the test's own child process with two lists (LEONIDA_PLACES_RUN):

samplers   the check   loaded   wrong   read    places
  25        75.0 ms    made      0      1, 2    same
 320       257.8 ms    loaded    0      1, 2    same

Sorry for the duplicate: this was opened in an earlier round and #2996 later, and AGENTS.md's own rule - look at the open pull requests first - is what I did not do.

AI-assisted: yes - DeepSeek v4.1 (flash).

Written with an AI assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants